3.224 \(\int \cot ^3(c+d x) (a+a \sec (c+d x))^n \, dx\)

Optimal. Leaf size=127 \[ -\frac{a (4-n) (a \sec (c+d x)+a)^{n-1} \text{Hypergeometric2F1}\left (1,n-1,n,\frac{1}{2} (\sec (c+d x)+1)\right )}{4 d (1-n)}+\frac{a (a \sec (c+d x)+a)^{n-1} \text{Hypergeometric2F1}(1,n-1,n,\sec (c+d x)+1)}{d (1-n)}+\frac{a (a \sec (c+d x)+a)^{n-1}}{2 d (1-\sec (c+d x))} \]

[Out]

-(a*(4 - n)*Hypergeometric2F1[1, -1 + n, n, (1 + Sec[c + d*x])/2]*(a + a*Sec[c + d*x])^(-1 + n))/(4*d*(1 - n))
 + (a*Hypergeometric2F1[1, -1 + n, n, 1 + Sec[c + d*x]]*(a + a*Sec[c + d*x])^(-1 + n))/(d*(1 - n)) + (a*(a + a
*Sec[c + d*x])^(-1 + n))/(2*d*(1 - Sec[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.109211, antiderivative size = 127, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.238, Rules used = {3880, 103, 156, 65, 68} \[ -\frac{a (4-n) (a \sec (c+d x)+a)^{n-1} \, _2F_1\left (1,n-1;n;\frac{1}{2} (\sec (c+d x)+1)\right )}{4 d (1-n)}+\frac{a (a \sec (c+d x)+a)^{n-1} \, _2F_1(1,n-1;n;\sec (c+d x)+1)}{d (1-n)}+\frac{a (a \sec (c+d x)+a)^{n-1}}{2 d (1-\sec (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^3*(a + a*Sec[c + d*x])^n,x]

[Out]

-(a*(4 - n)*Hypergeometric2F1[1, -1 + n, n, (1 + Sec[c + d*x])/2]*(a + a*Sec[c + d*x])^(-1 + n))/(4*d*(1 - n))
 + (a*Hypergeometric2F1[1, -1 + n, n, 1 + Sec[c + d*x]]*(a + a*Sec[c + d*x])^(-1 + n))/(d*(1 - n)) + (a*(a + a
*Sec[c + d*x])^(-1 + n))/(2*d*(1 - Sec[c + d*x]))

Rule 3880

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> -Dist[(d*b^(m - 1)
)^(-1), Subst[Int[((-a + b*x)^((m - 1)/2)*(a + b*x)^((m - 1)/2 + n))/x, x], x, Csc[c + d*x]], x] /; FreeQ[{a,
b, c, d, n}, x] && IntegerQ[(m - 1)/2] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[n]

Rule 103

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*(a +
 b*x)^(m + 1)*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/((m + 1)*(b*c - a*d)*(b*e - a*f)), x] + Dist[1/((m + 1)*(b*
c - a*d)*(b*e - a*f)), Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p*Simp[a*d*f*(m + 1) - b*(d*e*(m + n + 2) +
 c*f*(m + p + 2)) - b*d*f*(m + n + p + 3)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && LtQ[m, -1] &&
 IntegerQ[m] && (IntegerQ[n] || IntegersQ[2*n, 2*p])

Rule 156

Int[(((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :>
 Dist[(b*g - a*h)/(b*c - a*d), Int[(e + f*x)^p/(a + b*x), x], x] - Dist[(d*g - c*h)/(b*c - a*d), Int[(e + f*x)
^p/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h}, x]

Rule 65

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x)^(n + 1)*Hypergeometric2F1[-m, n +
 1, n + 2, 1 + (d*x)/c])/(d*(n + 1)*(-(d/(b*c)))^m), x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (Inte
gerQ[m] || GtQ[-(d/(b*c)), 0])

Rule 68

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((b*c - a*d)^n*(a + b*x)^(m + 1)*Hype
rgeometric2F1[-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b^(n + 1)*(m + 1)), x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rubi steps

\begin{align*} \int \cot ^3(c+d x) (a+a \sec (c+d x))^n \, dx &=\frac{a^4 \operatorname{Subst}\left (\int \frac{(a+a x)^{-2+n}}{x (-a+a x)^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac{a (a+a \sec (c+d x))^{-1+n}}{2 d (1-\sec (c+d x))}-\frac{a \operatorname{Subst}\left (\int \frac{(a+a x)^{-2+n} \left (2 a^2+a^2 (2-n) x\right )}{x (-a+a x)} \, dx,x,\sec (c+d x)\right )}{2 d}\\ &=\frac{a (a+a \sec (c+d x))^{-1+n}}{2 d (1-\sec (c+d x))}+\frac{a^2 \operatorname{Subst}\left (\int \frac{(a+a x)^{-2+n}}{x} \, dx,x,\sec (c+d x)\right )}{d}-\frac{\left (a^3 (4-n)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{-2+n}}{-a+a x} \, dx,x,\sec (c+d x)\right )}{2 d}\\ &=-\frac{a (4-n) \, _2F_1\left (1,-1+n;n;\frac{1}{2} (1+\sec (c+d x))\right ) (a+a \sec (c+d x))^{-1+n}}{4 d (1-n)}+\frac{a \, _2F_1(1,-1+n;n;1+\sec (c+d x)) (a+a \sec (c+d x))^{-1+n}}{d (1-n)}+\frac{a (a+a \sec (c+d x))^{-1+n}}{2 d (1-\sec (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.216217, size = 96, normalized size = 0.76 \[ -\frac{a (a (\sec (c+d x)+1))^{n-1} \left ((n-4) (\sec (c+d x)-1) \text{Hypergeometric2F1}\left (1,n-1,n,\frac{1}{2} (\sec (c+d x)+1)\right )+4 (\sec (c+d x)-1) \text{Hypergeometric2F1}(1,n-1,n,\sec (c+d x)+1)+2 n-2\right )}{4 d (n-1) (\sec (c+d x)-1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^3*(a + a*Sec[c + d*x])^n,x]

[Out]

-(a*(-2 + 2*n + (-4 + n)*Hypergeometric2F1[1, -1 + n, n, (1 + Sec[c + d*x])/2]*(-1 + Sec[c + d*x]) + 4*Hyperge
ometric2F1[1, -1 + n, n, 1 + Sec[c + d*x]]*(-1 + Sec[c + d*x]))*(a*(1 + Sec[c + d*x]))^(-1 + n))/(4*d*(-1 + n)
*(-1 + Sec[c + d*x]))

________________________________________________________________________________________

Maple [F]  time = 0.23, size = 0, normalized size = 0. \begin{align*} \int \left ( \cot \left ( dx+c \right ) \right ) ^{3} \left ( a+a\sec \left ( dx+c \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^3*(a+a*sec(d*x+c))^n,x)

[Out]

int(cot(d*x+c)^3*(a+a*sec(d*x+c))^n,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+a*sec(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((a*sec(d*x + c) + a)^n*cot(d*x + c)^3, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+a*sec(d*x+c))^n,x, algorithm="fricas")

[Out]

integral((a*sec(d*x + c) + a)^n*cot(d*x + c)^3, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**3*(a+a*sec(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right )^{3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+a*sec(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((a*sec(d*x + c) + a)^n*cot(d*x + c)^3, x)